import time

import self
from appium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
import os
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC


os.system('adb root')
cap = {
  "platformName": "Android",
  "deviceName": "emulator-5554",
  "appPackage": "com.kongfz.app",
  "appActivity": "com.kongfz.app.home.mvvm.homepage.HomeActivity",
  "noReset": True
}
# driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub',cap)
# ele = WebDriverWait(self.driver,15).until(EC.presence_of_element_located((By.ID,'com.kongfz.app:id/lav_1')))
# assert "相关版本在售" in ele.text
#
#
# self.driver.implicitly_wait(25)
# sleep(12)
#
# t = time.strftime("%Y%m%d%H%M%S",time.localtime())
# self.driver.save_screenshot(t+"sousouerror.png")
#
print("打印当前上下文的所有环境:",self.driver.contexts)

